View Javadoc

1   // jq_MainThread.java, created Mon Apr  9  1:52:50 2001 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.Scheduler;
5   
6   import joeq.Class.jq_StaticMethod;
7   import joeq.Runtime.Reflection;
8   
9   /*
10   * @author  John Whaley <jwhaley@alum.mit.edu>
11   * @version $Id: jq_MainThread.java 1456 2004-03-09 22:01:46Z jwhaley $
12   */
13  public class jq_MainThread extends java.lang.Thread {
14  
15      jq_StaticMethod m;
16      Object arg;
17      
18      /*** Creates new MainThread */
19      public jq_MainThread(jq_StaticMethod m, Object arg) {
20          this.m = m; this.arg = arg;
21      }
22      
23      public void run() {
24          try {
25              Reflection.invokestatic_V(m, arg);
26          } catch (Throwable t) {
27              System.err.println("Exception occurred! "+t);
28              t.printStackTrace(System.err);
29              System.exit(-1);
30          }
31      }
32  
33  }